package com.code.zjm.demo.ui;

import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v7.app.AppCompatActivity;
import android.widget.ArrayAdapter;
import android.widget.Spinner;

/**
 * Created by ZJM on 2017/3/3.
 */
public class AtyShowSpinner extends AppCompatActivity {
    private Spinner spinner;
    private ArrayAdapter<String> adapter;


    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_spinner);
        spinner = (Spinner) findViewById(R.id.spinner);
        adapter = new ArrayAdapter<>(this,android.R.layout.simple_list_item_1);
        spinner.setAdapter(adapter);

        adapter.add("Hello");
        adapter.add("Lin");
    }
}
